<%@page import="servlets.MainServlet"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<link href="../css/table.css" rel="stylesheet" type="text/css">
<link href="../css/button.css" rel="stylesheet" type="text/css">

<jsp:include page="header.jsp" flush="true" />
<div id="content">
	<div class="styled-table">
		<table style="width: 98%;">
			<thead>
				<tr>
					<td>Dominio</td> 
					<td>Tipo de Vehículo</td>
					<td>Peso Tara</td>
					<td>Kilometraje</td>
					<td>Peso Máximo de Carga</td>
					<td>Volumen Máximo de Carga</td>
					<td>Refrigerado</td>
					<td>En garantía</td>
					<td></td>
				</tr>
			</thead>
			<c:if test="${vehiculos != null}">
				<c:forEach items="${vehiculos}" var="vehiculo" varStatus="status">
					<tbody>
						<tr>
							<td><c:out value="${vehiculo.dominio}"/></td>						
							<td>
								<c:choose>
									<c:when test="${vehiculo.tipo == 1 }">
										Tractor
								    </c:when>
								    <c:when test="${vehiculo.tipo == 2 }">
										Camión
								    </c:when>        
								    <c:otherwise>
								    	Camioneta
								    </c:otherwise>
								</c:choose>
							</td>
							<td><c:out value="${vehiculo.pesoTaraKG}" /> Kg</td>
							<td><c:out value="${vehiculo.kilometrajeKM}" /> Km</td>
							<td><c:out value="${vehiculo.pesoMaximoCargaKG}" /> Kg</td>
							<td><c:out value="${vehiculo.volumenMaximoCargaM3}" /> M3</td>
							<td><c:out value="${vehiculo.esRefrigerado ? 'Refrigerado' : 'No refrigerado'}" /></td>	
							<td><c:out value="${vehiculo.estaEnGarantia ? 'En garantía' : 'No en garantía'}" /></td>			
							
							<td><a href="../servlet/mainServlet?actionId=8&dominio=<c:out value="${vehiculo.dominio}"/>" class="myButton"">Ver Vehículo</a></td>
						</tr>
					</tbody>
				</c:forEach>
		</c:if>		
		</table>
	</div>
</div><!-- content -->
<jsp:include page="footer.jsp" flush="true" />